<?php
registerTable("student_profile", new table_student_profile());

class table_student_profile extends Database
{
    public function __construct()
    {
        parent::__construct("student_profile");
    }
    
    public function insert_data($profile)
    {
        return parent::insert($profile);
    }
    
    public function fetch_all_by_class($class)
    {
        $res = parent::fetch_assoc("`classid`='$class'", "*");
        if (parent::isEmpty())
            return - 1;
            return $res;
    }
    
    public function fetch_all_by_mail($grade)
    {
        $res = parent::fetch_assoc("`gradeid`='$grade'", "*");
        if (parent::isEmpty())
            return - 1;
            return $res;
    }
    
    public function fetch_all_by_studentid($student)
    {
        $res = parent::fetch_assoc("`studentid`='$student'", "*");
        if (parent::isEmpty())
            return - 1;
            return $res;
    }
}
?>